package com.example.springbootvuetest.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 *
 * </p>
 *
 * @author shuoye
 * @since 2023-03-14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sh_message")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("id")
    private Integer id;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    private Integer userId;

    /**
     * 闲置id
     */
    @ApiModelProperty("闲置id")
    private Integer idleId;

    /**
     * 内容
     */
    @ApiModelProperty("内容")
    private String content;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd: HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 收信人
     */
    @ApiModelProperty("收信人")
    private Integer toUser;

    /**
     * 所回复的留言
     */
    @ApiModelProperty("所回复的留言")
    private Integer toMessage;

    @TableField(exist = false)
    @ApiModelProperty("发件人信息")
    private User fromU;

    @TableField(exist = false)
    @ApiModelProperty("收件人信息")
    private User toU;

    @TableField(exist = false)
    @ApiModelProperty("闲置物品信息")
    private IdleItem idle;

    @TableField(exist = false)
    @ApiModelProperty("收信人消息")
    private Message toM;

}
